/**
 * @param {string} s
 * @return {string}
 */
var makeGood = function(s) {
  function isConflict(i) {
    if(Math.abs(arr[i].charCodeAt() - arr[i + 1].charCodeAt()) == 32) {
      return true;
    } else {
      return false;
    }
  }
  let arr = s.split("");
  for(let i = 0; i < arr.length - 1; i++) {
    if(isConflict(i)) {
      arr.splice(i, 2);
      if(i - 2 < 0) {
        i = -1;
      } else {
        i -= 2;
      }
    }
  }
  return arr.join("");
};
let s = "leEeetcode";
console.log(makeGood(s));
s = "abBAcC";
console.log(makeGood(s));
s = "s";
console.log(makeGood(s));
